package cn.sh.tools.controller;

import cn.sh.tools.service.component.wechat.BusinessWeChatComponent;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "企业微信")
@RestController
@RequestMapping(value = "/businessWeChat")
public class BusinessWeChatController {

    @Autowired
    private BusinessWeChatComponent businessWeChatComponent;

    @ApiOperation("消息推送")
    @RequestMapping(method = RequestMethod.POST, value = "/msgPut")
    public void msgPut(@RequestParam(value = "departmentId", required = false) String departmentId,
                       @RequestParam(value = "msgContent") String msgContent) {
        this.businessWeChatComponent.msgPut(departmentId, msgContent);
    }

}
